package com.lemon.controller;

import com.lemon.domain.PageResult;
import com.lemon.domain.Result;
import com.lemon.domain.pageParam.SkuPageParam;
import com.lemon.domain.pageParam.SpuPageParam;
import com.lemon.service.SkuService;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/sku")
public class SkuController {

    @Autowired
    private SkuService skuService;

    @GetMapping
    @Operation(description = "查询所有商品")
    public Result getList(SkuPageParam skuPageParam) {
        PageResult list = skuService.getAll(skuPageParam);
        return Result.success(list);
    }
}
